#ifndef SLL_LIST_H
#define SLL_LIST_H

#include "kservice.h"

struct sll_list_node
{
    struct sll_list_node *next;
    struct sll_list_node *prev;
};

typedef struct sll_list_node sll_list_t;

//get the struct for this entry
//node  the entry point
//type  the type of structure
//member the name of list in structure
#define sll_list_entry(node, type, member) \
    ((type *)((char *)(node) - (unsigned long)(&((type *)0)->member)))
        
void sll_list_init(sll_list_t *l);

void sll_list_insert_after(sll_list_t *l, sll_list_t *n);

void sll_list_insert_before(sll_list_t *l, sll_list_t *n);
    
void sll_list_remove(sll_list_t *n);
 
int sll_list_empty(sll_list_t *l);


#endif

